package com.srpngfox.demo.domain;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.NonNull;

import javax.validation.constraints.*;

@Data
@NoArgsConstructor
@AllArgsConstructor
@ApiModel("用户基本信息")
public class User {
    @ApiModelProperty(value = "用户编号")
    private Long id;

    @NotNull
    @Size(min = 2, max = 20)
    @ApiModelProperty("姓名")
    private String name;

    @NotNull
    @Size(min = 1, max = 120)
    @ApiModelProperty("年龄")
    private Integer age;

    @NotNull
    @Size(min = 1, max = 120)
    @ApiModelProperty("年龄")
    private Integer xxx;


    @NotNull
    @ApiModelProperty("地址")
    private String address;

    @ApiModelProperty("邮箱")
    @Pattern(regexp = "^[a-zA-Z0-9_-]+@[a-zA-Z0-9_-]+(\\.[a-zA-Z0-9_-]+)+$")
    private String email;
}
